import JSEncrypt from '../static/plugins/js/jsencrypt.min.js'


const publicKey =`MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJzV2vWzA+V0KSO4RR+ui6Udu48F16A2
WXtMBvrHin5jc0y4adTE0G3Uua0dhkokemwowTjvWONJDgHz0zEU2VMCAwEAAQ==`

const privateKey =`MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAnNXa9bMD5XQpI7hF
H66LpR27jwXXoDZZe0wG+seKfmNzTLhp1MTQbdS5rR2GSiR6bCjBOO9Y40kOAfPT
MRTZUwIDAQABAkA8OWrBWqKuY7LAgqwYhGAfYZF6VFX+saAe1oz/k8w8x72rsCoI
JPUm2FT1YrjtCovx+9rwsIxPGZ6Q5Wh6jRKBAiEAz7r3lKQG5Yrumc0DoCirZ+xS
bdP9R/iHtRoeN8UwiWECIQDBR1qFZP90pMqJ77BJDNQGOdpN0HQKIBmwM0s/bBRb
MwIgUHmBIn9tAI4TI1guGGTJCoid4lhm3fPlNv64SCjHReECIGgOFTLpzAotSgl2
7G53pJJxhRENn9tvqsTM6L8NXew3AiEAmj3PfK1P76yWeqekALUnwIST+2sBc28M
nqWzMkOKw38=`


// 加密
export function  encrypt(txt){
	const encryptor = new JSEncrypt()
	encryptor.setPublicKey(publicKey)
	return encryptor.encrypt(txt)
}
//解密

export function decrypt(txt){
	const encryptor = new JSEncrypt()
	encryptor.setPrivateKey(privateKey)
	return encryptor.decrypt(txt)
}